home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PASCSRC.ZIP / BINOUT.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  788b  |  30 lines

  1.                                 (* Chapter 11 - Program 6 *)
  2. program Binary_Output_Example;
  3.  
  4. type Dat_Rec = record
  5.        Count : integer;
  6.        Size  : real;
  7.        Name  : string[30];
  8.      end;
  9.  
  10. var Output_File : file of Dat_Rec;
  11.     Dog_Food    : array[1..20] of Dat_Rec;
  12.     Index       : byte;
  13.  
  14. begin  (* main program *)
  15.    Assign(Output_File,'KIBBLES.BIT');
  16.    Rewrite(Output_File);
  17.  
  18.    for Index := 1 to 20 do begin
  19.       Dog_Food[Index].Count := Index;
  20.       Dog_Food[Index].Size := 12345.6789;
  21.       Dog_Food[Index].Name := 'Large size Kibbles & Bits';
  22.    end;
  23.  
  24.    Writeln('Begin outputting data');
  25.    for Index := 1 to 20 do
  26.       Write(Output_File,Dog_Food[Index]);
  27.    Close(Output_File);
  28.    Writeln('End of output');
  29. end.  (* of main program *)
  30.